/**
 * 
 */
package dms.service.imp;

import java.util.Date;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import dms.model.Building;
import dms.model.Campus;
import dms.model.form.Notice;
import dms.model.util.PageIterator;
import dms.repository.NoticeRepository;
import dms.service.NoticeQueryService;

/**
 * @author 李健
 *
 */
public class NoticeQueryServiceImpl implements NoticeQueryService {

	private static final Log log = LogFactory.getLog(NoticeQueryServiceImpl.class);

	private NoticeRepository noticeRepository = null;
	
	/* (non-Javadoc)
	 * @see dms.service.NoticeQueryService#findAllFoundNotice(int, int, java.lang.String, java.util.Date, java.util.Date, java.lang.Boolean)
	 */
	/**
	 * @return the noticeRepository
	 */
	public NoticeRepository getNoticeRepository() {
		return noticeRepository;
	}

	/**
	 * @param noticeRepository the noticeRepository to set
	 */
	public void setNoticeRepository(NoticeRepository noticeRepository) {
		this.noticeRepository = noticeRepository;
	}

	@Override
	public PageIterator<Notice> findAllFoundNotice(int start, int count,
			String query, Date fromDate, Date toDate, Boolean applied) {
		return  this.noticeRepository.findAllFoundNotice(start, count, query, fromDate, toDate, applied);
	}

	/* (non-Javadoc)
	 * @see dms.service.NoticeQueryService#findAllLostNotice(int, int, java.lang.String, java.util.Date, java.util.Date, java.lang.Boolean)
	 */
	@Override
	public PageIterator<Notice> findAllLostNotice(int start, int count,
			String query, Date fromDate, Date toDate, Boolean applied) {
		return this.noticeRepository.findAllLostNotice(start, count, query, fromDate, toDate, applied);
	}

	/* (non-Javadoc)
	 * @see dms.service.NoticeQueryService#findFoundNoticeByBuilding(int, int, java.lang.String, java.util.Date, java.util.Date, java.lang.Boolean)
	 */
	@Override
	public PageIterator<Notice> findFoundNoticeByBuilding(int start, int count, Building building, 
			String query, Date fromDate, Date toDate, Boolean applied) {
		return this.noticeRepository.findFoundNoticeByBuildingAndQuery(start, count, building, query, fromDate, toDate, applied);
	}

	/* (non-Javadoc)
	 * @see dms.service.NoticeQueryService#findFoundNoticeByCampus(int, int, java.lang.String, java.util.Date, java.util.Date, java.lang.Boolean)
	 */
	@Override
	public PageIterator<Notice> findFoundNoticeByCampus(int start, int count, Campus campus, 
			String query, Date fromDate, Date toDate, Boolean applied) {
		return this.noticeRepository.findFoundNoticeByCampusAndQuery(start, count, campus, query, fromDate, toDate, applied);
	}

	/* (non-Javadoc)
	 * @see dms.service.NoticeQueryService#findLostNoticeByBuilding(int, int, java.lang.String, java.util.Date, java.util.Date, java.lang.Boolean)
	 */
	@Override
	public PageIterator<Notice> findLostNoticeByBuilding(int start, int count, Building building,  
			String query, Date fromDate, Date toDate, Boolean applied) {
		return this.noticeRepository.findLostNoticeByBuildingAndQuery(start, count, building, query, fromDate, toDate, applied);
	}

	/* (non-Javadoc)
	 * @see dms.service.NoticeQueryService#findLostNoticeByCampus(int, int, java.lang.String, java.util.Date, java.util.Date, java.lang.Boolean)
	 */
	@Override
	public PageIterator<Notice> findLostNoticeByCampus(int start, int count, Campus campus, 
			String query, Date fromDate, Date toDate, Boolean applied) {
		return this.noticeRepository.findLostNoticeByCampusAndQuery(start, count, campus, query, fromDate, toDate, applied);
	}

	/* (non-Javadoc)
	 * @see dms.service.NoticeQueryService#findNoticeById(java.lang.Long)
	 */
	@Override
	public Notice findNoticeById(Long id) {
		// TODO Auto-generated method stub
		return null;
	}

	/**
	 * @param noticeRepository
	 */
	public NoticeQueryServiceImpl(NoticeRepository noticeRepository) {
		super();
		this.noticeRepository = noticeRepository;
	}

	/**
	 * 
	 */
	public NoticeQueryServiceImpl() {
		super();
	}

}
